package com.jacobson.huobi.common.expansion

fun ByteArray.toHex(): String {
    val buffer = StringBuffer()
    forEach {
        var temp = Integer.toHexString(it.toInt().and(0xff))
        if (temp.length == 1) {
            temp = "0$temp"
        }
        buffer.append(temp)
    }
    return buffer.toString().trim()
}